Skip to content

test: disable the PyPI version check in tests - #971

Closed
tdstein wants to merge 1 commit into
mainfrom
test/disable-version-check
Closed

tdstein wants to merge 1 commit into
mainfrom
test/disable-version-check

Conversation

@tdstein

@tdstein tdstein commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

test_deploy_bundle fails intermittently with Could not connect to http://fake_server (RemoteDisconnected) whenever the version is a release version. It blocked the 1.33.2 tag build and also failed on 1.33.1 and #955.

On a release version, deploy checks PyPI for a newer version in a background thread. httpretty's fake socket keeps sent data in a class-level list (_sent_data = []) shared by every socket, and reads a request body back as the last item in that list. When the PyPI request lands in between, the mocked POST /deploy gets GET /pypi/rsconnect-python/json … as its body. The test callback raises JSONDecodeError, httpretty sends an empty response, and the client reports RemoteDisconnected.

This adds an autouse fixture that sets RSCONNECT_DISABLE_VERSION_CHECK=1. tests/test_version_check.py removes the variable in its own fixture, so those tests still run the check.

Evidence

  • CI traceback: post_application_deploy_callback → _load_json(request.body) → JSONDecodeError … (char 0), with a PyPI request a few milliseconds before the failure.
  • A standalone httpretty script (one thread POSTing JSON, another sending a PyPI GET) handed the PyPI request line to the POST callback in 639 of 2,000 requests on 3.13 and 534 of 2,000 on 3.14.
  • With this change and a cold cache, test_deploy_bundle makes no PyPI request. tests/test_version_check.py passes, and the full suite passes on 3.14 locally except test_quickstart.py, which fails the same way on main because of a local in-repo uv cache.

🤖 Generated with Claude Code

On a release version the background version check races httpretty's
shared fake-socket state and can corrupt a mocked request body, which
made test_deploy_bundle fail intermittently.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.2
Preview removed because the pull request was closed.
2026-11-12 17:17 UTC

@tdstein
tdstein marked this pull request as draft November 12, 2026 15:02
@github-actions

Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
11252 10032 89% 0% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: 09019df by action🐍

@tdstein

tdstein commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

I don't think this addresses the real issue. Closing.

@tdstein tdstein closed this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant